In AD802, Jayavarman II declared Kambuja free from the Saliendra Empire in a religious ceremony performed by a [G 08 / brahmin] in the king's palace. During the ceremony, the brahmin declared that in ruling, the king took on the earthly nature of a god.
The presence of a religious figure gave legitimacy to the declaration of independence from Java. This ceremony gave rise to the cult of a god-king in Cambodia, known as `devaraja,' and became the basis for a new Cambodian religion based first on Indian Hinduism. The `linga,' a symbol of the male sexual organ, was worshipped and kept in a temple attended by holy priests. They performed rituals of cleansing around the [I 002 / linga]. Water became an integral part of the religion, and eventually temples where surrounded by a moat to supply the water. The linga was both a symbol of the king's divine authority and of the Indian god [G 29 / Siva].
From Jayavarman II's time onwards, the kings of Kambuja were seen as demi-gods and the religion that surrounded the worship of the royal linga was the official state religion. Each king built a temple to house the linga and the temple became the king's tomb on his death.